<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!-- 级联菜单 -->
<!-- 
	WARNING: select要记得加默认选中，不然IE下无法触发onchange事件
 -->
<c:forEach items="${lstCascade}" var="lstColumns" varStatus="stat">
	<select id="col_${stat.index+1}" name="selectedCol" onchange="columnChange(this.options[this.options.selectedIndex].value)">
			<c:forEach items="${lstColumns}" var="columnItem" varStatus="statI">
			   <c:choose>
				<c:when test="${chosenSize >stat.index && columnItem.id==lstChosenIndex[stat.index]}">
					<option value="${columnItem.id}" selected="selected">${columnItem.name}</option>
				</c:when>
				<c:otherwise>
					<c:choose>
						<c:when test="${chosenSize <= stat.index && statI.index==0}">
							<option value="${columnItem.id}" selected="selected">${columnItem.name}</option>
						</c:when>
						<c:otherwise>
							<option value="${columnItem.id}">${columnItem.name}</option>
						</c:otherwise>
					</c:choose>
				</c:otherwise>
			 </c:choose>
			</c:forEach>
	</select>
</c:forEach>
<!--<script type="text/javascript" src="../../../javascripts/jquery-2.0.3.min.js"></script> 坑苦了我呀-->
<script type="text/javascript">
	function columnChange(coluID){
		$.ajaxSetup ({ cache: false });
		$(".columnChosen").load("<%=basePath%>/column/loadParentColumn/" + coluID);
	}
</script>

